package com.qd.common.panda.domain.entity.transfer;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 转账信息
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserTransferDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "转账信息";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "转账ID"})
    @NotBlank(message = "转账ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "转账ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String tid;
    /**
     * 用户ID
     */
    @ExcelProperty(value = {EXCEL_TITLE, "用户ID"})
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 收款户名
     */
    @ExcelProperty(value = {EXCEL_TITLE, "收款户名"})
    @NotBlank(message = "收款户名不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "收款户名长度不能超过{max}位", groups = DefaultGroup.class)
    private String userName;
    /**
     * 收款人手机号
     */
    @ExcelProperty(value = {EXCEL_TITLE, "收款人手机号"})
    private String mobile;
    /**
     * 收款卡号
     */
    @ExcelProperty(value = {EXCEL_TITLE, "收款卡号"})
    @NotBlank(message = "收款卡号不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "收款卡号长度不能超过{max}位", groups = DefaultGroup.class)
    private String cardNumber;
    /**
     * 开户银行
     */
    @ExcelProperty(value = {EXCEL_TITLE, "开户银行"})
    @NotBlank(message = "开户银行不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "开户银行长度不能超过{max}位", groups = DefaultGroup.class)
    private String openBank;
    /**
     * 转账金额
     */
    @ExcelIgnore
    private BigDecimal transferAmount;
    /**
     * 转账金额显示
     */
    @ExcelProperty(value = {EXCEL_TITLE, "转账金额"})
    private String transferAmountDisplay;
    /**
     * 添加时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "添加时间"})
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "更新时间"})
    private LocalDateTime updateTime;
    /**
     * 操作人
     */
    @ExcelIgnore
    @Size(max = 50, message = "操作人长度不能超过{max}位", groups = DefaultGroup.class)
    private String operator;
    /**
     * 操作人显示
     */
    @ExcelProperty(value = {EXCEL_TITLE, "操作人"})
    private String operatorDisplay;
    /**
     * 操作组织
     */
    @ExcelIgnore
    @NotBlank(message = "操作组织不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "操作组织长度不能超过{max}位", groups = DefaultGroup.class)
    private String operateOrgId;
    /**
     * 操作组织显示
     */
    @ExcelProperty(value = {EXCEL_TITLE, "操作组织"})
    private String operateOrgIdDisplay;

    @Override
    public void freeData() {
        this.tid = null;
        this.userName = null;
        this.mobile = null;
        this.cardNumber = null;
        this.openBank = null;
        this.transferAmount = null;
        this.transferAmountDisplay = null;
        this.addTime = null;
        this.updateTime = null;
        this.userId = null;
        this.operator = null;
        this.operatorDisplay = null;
        this.operateOrgId = null;
        this.operateOrgIdDisplay = null;
        super.freeData();
    }
}
